package com.unhz.generator.utils;

import com.unhz.generator.pojo.Node;

import java.util.Comparator;

/**
 * @Author: 沈佳庆
 * @Description: 节点比较器
 * @Date: Created in 下午 5:21 2018/1/29 0029
 * @Modified By:
 */
public class NodeIDComparator implements Comparator {

    // 按照节点编号比较
    public int compare(Object o1, Object o2) {
        int j1 = Integer.parseInt(((Node)o1).id);
        int j2 = Integer.parseInt(((Node)o2).id);
        return (j1 < j2 ? -1 : (j1 == j2 ? 0 : 1));
    }

}
